package com.study.controller;

import com.study.service.MyHealthState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class HealthStateController {


    @Autowired
    MyHealthState myHealthState;

    /*

        status=down 就不能向外界提供服务了

        http://localhost:8080/up?up=false
     */
    @RequestMapping("/up")
    public String up(@RequestParam("up") Boolean up) {
        myHealthState.setUp(up);

        return up.toString();
    }

}
